package com.appspot.jcmswiki.controller;

import java.io.IOException;
import javax.servlet.http.*;

import com.appspot.jcmswiki.command.Command;

@SuppressWarnings("serial")
public class FrontController extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		processRequest(req, resp);
	}

	public void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		processRequest(req, resp);
	}

	private void processRequest(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		RequestHelper requestHelper = new RequestHelper();
		Command command = requestHelper.getCommand(req);
		command.execute(req, resp);
	}
}
